﻿#region File and License Information
/*
<File>
	<License>
		Copyright © 2009 - 2017, Daniel Vaughan. All rights reserved.
		This file is part of Calcium (http://calciumsdk.net), 
		which is released under the MIT License.
		See file /Documentation/License.txt for details.
	</License>
	<CreationDate>2010-12-27 15:13:08Z</CreationDate>
</File>
*/
#endregion

using System;
using System.Collections.Generic;

using Microsoft.Practices.ServiceLocation;

namespace Outcoder.InversionOfControl.Containers
{
	/* TODO: [DV] Comment. */
	public class SimpleServiceLocatorAdapter : ServiceLocatorImplBase
	{
		readonly IContainer simpleContainer;

		public SimpleServiceLocatorAdapter(IContainer simpleContainer)
		{
			this.simpleContainer = simpleContainer;
		}

		protected override object DoGetInstance(Type serviceType, string key)
		{
			return simpleContainer.Resolve(serviceType, key);
		}

		protected override IEnumerable<object> DoGetAllInstances(Type serviceType)
		{
			return simpleContainer.ResolveAll(serviceType);
		}
	}
}